<?php
/**
 * Created by PhpStorm.
 * User: 董坤鸿
 * Date: 2017/1/16
 * Time: 17:46
 */
require_once 'ModelTestCase.php';

use EWeiLink\JuPai\Contact;
use MongoDB\BSON\Regex;
use EWeiLink\Jupai\Customer;

class ContactTest extends ModelTestCase
{
    /**
     * 查询联系人-带条件
     */
    public function testRelation(){
        $findName = 'Jay';
        $contacts = Contact::get();
        dumps($contacts->toJson(128+256));
        $this->assertGreaterThan(0, $contacts->count());
    }

    /**
     * 查询联系人-不带条件
     */
    public function testGetContactList()
    {
        $list = Contact::where('clientUin', '!=', 428764008)->count();
        dumps($list);
    }

    /**
     *  base64_encode + urlEncode 查询条件
     */
    public function testUrlEncode()
    {
        $url = base64_encode(urlencode('{"plannerId":2, "contactName":"Jay","bindState":1}'));
        echo $url;
        die;
    }
}